feat(web): add isSameNode for duplicate quotient-node detection 🚂#15478
Open
jahorton wants to merge 1 commit intofeat/web/spur-edge-keyfrom
Open
feat(web): add isSameNode for duplicate quotient-node detection 🚂#15478jahorton wants to merge 1 commit intofeat/web/spur-edge-keyfrom
jahorton wants to merge 1 commit intofeat/web/spur-edge-keyfrom
Conversation
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
403721b to
fbe4bec
Compare
a295e51 to
bb2c119
Compare
1d44f26 to
6306f5e
Compare
bb2c119 to
e69bb62
Compare
0c4a793 to
92546fa
Compare
e69bb62 to
71df397
Compare
92546fa to
240b1f6
Compare
71df397 to
1f4897f
Compare
240b1f6 to
76b3479
Compare
1f4897f to
56d7a8f
Compare
76b3479 to
2127072
Compare
56d7a8f to
d4f3a18
Compare
Build-bot: skip build:web Test-bot: test
d4f3a18 to
1755556
Compare
darcywong00
reviewed
Feb 6, 2026
| if(this.model != space.model) { | ||
| return false; | ||
| } | ||
| return true; |
Contributor
There was a problem hiding this comment.
Do these not have parents to check for match?
Contributor
Author
There was a problem hiding this comment.
It's the 'root' node - there is no parent here.
ermshiperete
approved these changes
Feb 10, 2026
| } | ||
|
|
||
| isSameNode(space: SearchQuotientNode): boolean { | ||
| // Easiest cases: when the instances or their ' `spaceId` matches, we have |
Contributor
There was a problem hiding this comment.
Suggested change
| // Easiest cases: when the instances or their ' `spaceId` matches, we have | |
| // Easiest cases: when the instances or their `spaceId` matches, we have |
Comment on lines
+198
to
+202
| // We need to check if the parents match. Done naively in the manner below, this is O(N^2). | ||
| // Granted, we shouldn't have _that_ many incoming paths. | ||
| if(this.parents.find((path) => !space.parents.find((path2) => path.isSameNode(path2)))) { | ||
| return false; | ||
| } |
Contributor
There was a problem hiding this comment.
Do we have to check that this and space have the same number of parents?
Suggested change
| // We need to check if the parents match. Done naively in the manner below, this is O(N^2). | |
| // Granted, we shouldn't have _that_ many incoming paths. | |
| if(this.parents.find((path) => !space.parents.find((path2) => path.isSameNode(path2)))) { | |
| return false; | |
| } | |
| if(this.parents.length != space.parents.length) { | |
| return false; | |
| } | |
| // We need to check if the parents match. Done naively in the manner below, this is O(N^2). | |
| // Granted, we shouldn't have _that_ many incoming paths. | |
| if(this.parents.find((path) => !space.parents.find((path2) => path.isSameNode(path2)))) { | |
| return false; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuing from #15508, this defines a method useful for determining if one SearchQuotientNode is a 100% match and duplicate for another node. While
.isSameNodeis only leveraged in unit tests within this PR, it sees use in runtime code starting with #15031.Build-bot: skip build:web
Test-bot: skip